#include "stdafx.h"
#include "CppUnitTest.h"

#include <HSModel/Model3DStorage.h>
#include <HSModel/World.h>
#include <HSModel/IRenderable.h>
#include <HSModel/Ground.h>
#include <HSModel/Human.h>
#include <HSModel/Tree.h>
#include <HSModel/FerrisWheel.h>
#include <HSModel/Bench.h>

using namespace Microsoft::VisualStudio::CppUnitTestFramework;

namespace HSModelTests
  {		
	TEST_CLASS(WorldBasicTests)
	  {
	  public:		
      TEST_METHOD(WorldTestAfterDefaultContructorShouldBeGround)
        {
        /* ---- Arrange ---- */
        World world;

        /* ---- Act ---- */
        auto p_ground = world.GetGround();

        /* ---- Assert ---- */
        Assert::IsTrue(nullptr != p_ground);

        }

      TEST_METHOD(ShouldGetRightItems)
        {
        /* ---- Arrange ---- */
        World world;

        /* Add 2 Humans */
        world.AddHuman(TVector3(250, 10, 250));
        world.AddHuman(TVector3(100, 100, 100));

        /* Add 4 trees */
        world.AddTree(TVector3(0, 0, 0));
        world.AddTree(TVector3(10, 10, 10));
        world.AddTree(TVector3(20, 20, 20));
        world.AddTree(TVector3(200, 0, 200));

        /* Add 1 FerrisWheel*/
        world.AddFerrisWheel(TVector3(40, 50, 60));

        /* Add 3 Benches*/
        world.AddBench(TVector2(70, 60));
        world.AddBench(TVector2(130, 150));
        world.AddBench(TVector2(200, 210));

        size_t actual_humans_quantity = 2;
        size_t actual_trees_quantity = 4;
        size_t actual_ferris_wheels_quantity = 1;
        size_t actual_benches_quantity = 3;

        /* ---- Act ---- */
        auto actual_humans = world.GetItems<Human>();
        auto actual_trees  = world.GetItems<Tree>();
        auto actual_ferris_wheels = world.GetItems<FerrisWheel>();
        auto actual_benches = world.GetItems<Bench>();

        /* ---- Assert ---- */
        Assert::AreEqual(actual_humans_quantity, actual_humans.size());
        Assert::AreEqual(actual_trees_quantity, actual_trees.size());
        Assert::AreEqual(actual_ferris_wheels_quantity, actual_ferris_wheels.size());
        Assert::AreEqual(actual_benches_quantity, actual_benches.size());
        }
    };
  }